import request from '@/utils/request'

// 封装获取部门信息函数
export function getDepartments() {
  return request({
    url: '/company/department'
  })
}

// 封装删除部门函数
export function delDepatment(id) {
  return request({
    url: `/company/department/${id}`,
    method: 'delete'
  })
}

// 创建新增部门函数
export function addDepartment(data) {
  return request({
    url: '/company/department',
    method: 'post',
    data
  })
}

// 创建获取部门详情函数
export function getDepartDetail(id) {
  return request({
    url: `/company/department/${id}`
  })
}

// 创建编辑部门函数
export function editDepartment(data) {
  return request({
    url: `/company/department/${data.id}`,
    method: 'put',
    data
  })
}
